package com.wicket.okrframework.web.contorller;

import com.github.pagehelper.Page;
import com.wicket.okrframework.biz.service.InductionRecordService;
import com.wicket.okrframework.biz.service.dto.req.*;
import com.wicket.okrframework.biz.service.dto.res.*;
import com.wicket.okrframework.common.ro.OkrResult;
import com.wicket.okrframework.common.util.CommonFunctionHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@RestController
@RequestMapping("/base/inductionRecord/")
public class InductionRecordController {

    @Autowired
    InductionRecordService inductionRecordService;

    /**
   * D1-3查询就职记录列表(边界)
   */
    @PostMapping("queryInductionRecordListBorder")
    public OkrResult<QueryInductionRecordListBorderRespDto> queryInductionRecordListBorder(@RequestBody @Validated QueryInductionRecordListBorderReqDto reqDTO){
        Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryInductionRecordListBorderRespDto retData = inductionRecordService.queryInductionRecordListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3批量查询就职记录列表（公共）
   */
    @PostMapping("batchQueryInductionRecordListCom")
    public OkrResult<BatchQueryInductionRecordListComRespDto> batchQueryInductionRecordListCom(@RequestBody @Validated BatchQueryInductionRecordListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryInductionRecordListCom(reqDTO));
    }

    /**
   * D1-3查询个人就职记录信息详情（公共）
   */
    @PostMapping("queryInductionRecordInfoDetailCom")
    public OkrResult<QueryInductionRecordInfoDetailComRespDto> queryInductionRecordInfoDetailCom(@RequestBody @Validated QueryInductionRecordInfoDetailComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionRecordInfoDetailCom(reqDTO));
    }

    /**
   * D1-3查询部门下就职记录列表（边界）
   */
    @PostMapping("queryDeptInductionRecordList")
    public OkrResult<QueryDeptInductionRecordListRespDto> queryDeptInductionRecordList(@RequestBody @Validated QueryDeptInductionRecordListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryDeptInductionRecordListRespDto retData = inductionRecordService.queryDeptInductionRecordList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3查询无组织架构就职记录列表（边界）
   */
    @PostMapping("queryUnstructuredInductionRecordListBorder")
    public OkrResult<QueryUnstructuredInductionRecordListBorderRespDto> queryUnstructuredInductionRecordListBorder(@RequestBody @Validated QueryUnstructuredInductionRecordListBorderReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryUnstructuredInductionRecordListBorderRespDto retData = inductionRecordService.queryUnstructuredInductionRecordListBorder(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3查询更新的就职记录列表
   */
    @PostMapping("queryUpdatedInductionList")
    public OkrResult<QueryUpdatedInductionListRespDto> queryUpdatedInductionList(@RequestBody @Validated QueryUpdatedInductionListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryUpdatedInductionListRespDto retData = inductionRecordService.queryUpdatedInductionList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3查询直属就职记录列表
   */
    @PostMapping("queryDirectInductionRecordList")
    public OkrResult<QueryDirectInductionRecordListRespDto> queryDirectInductionRecordList(@RequestBody @Validated QueryDirectInductionRecordListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryDirectInductionRecordListRespDto retData = inductionRecordService.queryDirectInductionRecordList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3查询就职记录详情
   */
    @PostMapping("queryInductionRecordDetail")
    public OkrResult<QueryInductionRecordDetailRespDto> queryInductionRecordDetail(@RequestBody @Validated QueryInductionRecordDetailReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionRecordDetail(reqDTO));
    }

    /**
     * D1-3一键更新职务信息
     */
    @PostMapping("batchUpdateInductionRecord")
    public OkrResult<BatchUpdateInductionRecordRespDto> batchUpdateInductionRecord(@RequestBody @Validated BatchUpdateInductionRecordReqDto reqDTO) {
        return OkrResult.success(inductionRecordService.batchUpdateInductionRecord(reqDTO));
    }

    /**
   * D1-3查就职记录列表
   */
    @PostMapping("queryInductionRecordList")
    public OkrResult<QueryInductionRecordListRespDto> queryInductionRecordList(@RequestBody @Validated QueryInductionRecordListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryInductionRecordListRespDto retData = inductionRecordService.queryInductionRecordList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3撤销想存档就职记录
   */
    @PostMapping("undoToArchiveInductionRecord")
    public OkrResult<UndoToArchiveInductionRecordRespDto> undoToArchiveInductionRecord(@RequestBody @Validated UndoToArchiveInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.undoToArchiveInductionRecord(reqDTO));
    }

    /**
   * D1-3查询非直属就职记录列表
   */
    @PostMapping("queryUndoDirectInductionRecordList")
    public OkrResult<QueryUndoDirectInductionRecordListRespDto> queryUndoDirectInductionRecordList(@RequestBody @Validated QueryUndoDirectInductionRecordListReqDto reqDTO){
    Page<?> page = CommonFunctionHelper.startPage(reqDTO.getPageNum(),reqDTO.getPageSize());

        QueryUndoDirectInductionRecordListRespDto retData = inductionRecordService.queryUndoDirectInductionRecordList(reqDTO);

        retData.setPageNum(page.getPageNum());
        retData.setPageSize(page.getPageSize());
        retData.setTotalNum(page.getTotal());
        return OkrResult.success(retData);
    
    }

    /**
   * D1-3存档就职记录
   */
    @PostMapping("archiveInductionRecord")
    public OkrResult<ArchiveInductionRecordRespDto> archiveInductionRecord(@RequestBody @Validated ArchiveInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.archiveInductionRecord(reqDTO));
    }

    /**
   * D1-3调岗就职记录
   */
    @PostMapping("postTransferInductionRecord")
    public OkrResult<PostTransferInductionRecordRespDto> postTransferInductionRecord(@RequestBody @Validated PostTransferInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.postTransferInductionRecord(reqDTO));
    }

    /**
   * D1-3补充系统职务（边界）
   */
    @PostMapping("perfectSystemPosition")
    public OkrResult<PerfectSystemPositionRespDto> perfectSystemPosition(@RequestBody @Validated PerfectSystemPositionReqDto reqDTO){
    return OkrResult.success(inductionRecordService.perfectSystemPosition(reqDTO));
    }

    /**
   * D1-3修改就职记录
   */
    @PostMapping("updateInductionRecord")
    public OkrResult<UpdateInductionRecordRespDto> updateInductionRecord(@RequestBody @Validated UpdateInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.updateInductionRecord(reqDTO));
    }

    /**
   * D1-3查询就职记录详情(边界)
   */
    @PostMapping("queryInductionRecordDetailBorder")
    public OkrResult<QueryInductionRecordDetailBorderRespDto> queryInductionRecordDetailBorder(@RequestBody @Validated QueryInductionRecordDetailBorderReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionRecordDetailBorder(reqDTO));
    }

    /**
   * D1-3删除就职记录
   */
    @PostMapping("deleteInductionRecord")
    public OkrResult<DeleteInductionRecordRespDto> deleteInductionRecord(@RequestBody @Validated DeleteInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.deleteInductionRecord(reqDTO));
    }
/**
   * D1判断新增就职记录操作可用(公共)
   */
    @PostMapping("judgeAddInductionRecordUsableCom")
    public OkrResult<JudgeAddInductionRecordUsableComRespDto> judgeAddInductionRecordUsableCom(@RequestBody @Validated JudgeAddInductionRecordUsableComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.judgeAddInductionRecordUsableCom(reqDTO));
    }
/**
   * D1-3批量查询就职记录(边界)
   */
    @PostMapping("batchQueryInductionRecordBorder")
    public OkrResult<BatchQueryInductionRecordBorderRespDto> batchQueryInductionRecordBorder(@RequestBody @Validated BatchQueryInductionRecordBorderReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryInductionRecordBorder(reqDTO));
    }
/**
   * D1-3新增就职记录
   */
    @PostMapping("addInductionRecord")
    public OkrResult<AddInductionRecordRespDto> addInductionRecord(@RequestBody @Validated AddInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.addInductionRecord(reqDTO));
    }
/**
   * D1-2执行主岗唯一处理(公共)
   */
    @PostMapping("implementMajorPositionOnlyHandleCom")
    public OkrResult<ImplementMajorPositionOnlyHandleComRespDto> implementMajorPositionOnlyHandleCom(@RequestBody @Validated ImplementMajorPositionOnlyHandleComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementMajorPositionOnlyHandleCom(reqDTO));
    }
/**
   * D1-3查询就职记录列表(公共)
   */
    @PostMapping("queryInductionRecordListCom")
    public OkrResult<QueryInductionRecordListComRespDto> queryInductionRecordListCom(@RequestBody @Validated QueryInductionRecordListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionRecordListCom(reqDTO));
    }
/**
   * D1-3批量查询直属就职记录
   */
    @PostMapping("batchQueryDirectInductionRecord")
    public OkrResult<BatchQueryDirectInductionRecordRespDto> batchQueryDirectInductionRecord(@RequestBody @Validated BatchQueryDirectInductionRecordReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryDirectInductionRecord(reqDTO));
    }
/**
   * D1-3查询部门下直属就职记录列表
   */
    @PostMapping("queryDeptDirectlyInductionRecordList")
    public OkrResult<QueryDeptDirectlyInductionRecordListRespDto> queryDeptDirectlyInductionRecordList(@RequestBody @Validated QueryDeptDirectlyInductionRecordListReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryDeptDirectlyInductionRecordList(reqDTO));
    }
/**
   * D1-3查询正副职就职记录列表(公共)
   */
    @PostMapping("queryDeputyInductionRecordListCom")
    public OkrResult<QueryDeputyInductionRecordListComRespDto> queryDeputyInductionRecordListCom(@RequestBody @Validated QueryDeputyInductionRecordListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryDeputyInductionRecordListCom(reqDTO));
    }
/**
   * D1-3批量查询就职记录(管理)(公共)
   */
    @PostMapping("batchQueryInductionRecordCom")
    public OkrResult<BatchQueryInductionRecordComRespDto> batchQueryInductionRecordCom(@RequestBody @Validated BatchQueryInductionRecordComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryInductionRecordCom(reqDTO));
    }
/**
   * D1-3批量查询身份人员就职记录(公共)
   */
    @PostMapping("batchQueryOriginalRoleMemberInductionRecordCom")
    public OkrResult<BatchQueryOriginalRoleMemberInductionRecordComRespDto> batchQueryOriginalRoleMemberInductionRecordCom(@RequestBody @Validated BatchQueryOriginalRoleMemberInductionRecordComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryOriginalRoleMemberInductionRecordCom(reqDTO));
    }
/**
   * D1执行回写部门主管(公共)
   */
    @PostMapping("implementWriteBackDeptControllerDisposeCom")
    public OkrResult<ImplementWriteBackDeptControllerDisposeComRespDto> implementWriteBackDeptControllerDisposeCom(@RequestBody @Validated ImplementWriteBackDeptControllerDisposeComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementWriteBackDeptControllerDisposeCom(reqDTO));
    }
/**
   * D1-执行分析新增就职记录是否主岗(公共)
   */
    @PostMapping("implementAnalyzeNewInductionRecordIsMajorPositionCom")
    public OkrResult<ImplementAnalyzeNewInductionRecordIsMajorPositionComRespDto> implementAnalyzeNewInductionRecordIsMajorPositionCom(@RequestBody @Validated ImplementAnalyzeNewInductionRecordIsMajorPositionComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementAnalyzeNewInductionRecordIsMajorPositionCom(reqDTO));
    }
/**
   * D1-设置主岗(公共)
   */
    @PostMapping("implementSetMajorPositionCom")
    public OkrResult<ImplementSetMajorPositionComRespDto> implementSetMajorPositionCom(@RequestBody @Validated ImplementSetMajorPositionComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementSetMajorPositionCom(reqDTO));
    }
/**
   * D1-当前员工设主岗元素分析(公共)
   */
    @PostMapping("implementCurrentStaffMajorPositionElementAnalyseCom")
    public OkrResult<ImplementCurrentStaffMajorPositionElementAnalyseComRespDto> implementCurrentStaffMajorPositionElementAnalyseCom(@RequestBody @Validated ImplementCurrentStaffMajorPositionElementAnalyseComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementCurrentStaffMajorPositionElementAnalyseCom(reqDTO));
    }
/**
   * D1-执行清理空间管理员临时就职记录(公共)
   */
    @PostMapping("implementCleanSpaceAdminTtemporarynductionCom")
    public OkrResult<ImplementCleanSpaceAdminTtemporarynductionComRespDto> implementCleanSpaceAdminTtemporarynductionCom(@RequestBody @Validated ImplementCleanSpaceAdminTtemporarynductionComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementCleanSpaceAdminTtemporarynductionCom(reqDTO));
    }
/**
   * D1执行分析就职记录生命周期操作条件
   */
    @PostMapping("implementAnalyseInductionRecordLifecyCycleOperationTerm")
    public OkrResult<ImplementAnalyseInductionRecordLifecyCycleOperationTermRespDto> implementAnalyseInductionRecordLifecyCycleOperationTerm(@RequestBody @Validated ImplementAnalyseInductionRecordLifecyCycleOperationTermReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementAnalyseInductionRecordLifecyCycleOperationTerm(reqDTO));
    }
/**
   * D1执行分析是否行政主管(公共)
   */
    @PostMapping("implementAnalyseIsXzDirectorCom")
    public OkrResult<ImplementAnalyseIsXzDirectorComRespDto> implementAnalyseIsXzDirectorCom(@RequestBody @Validated ImplementAnalyseIsXzDirectorComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementAnalyseIsXzDirectorCom(reqDTO));
    }
/**
   * D1执行按条件查部门正副职(公共)
   */
    @PostMapping("implementAccConditionQueryDeptDeputyCom")
    public OkrResult<ImplementAccConditionQueryDeptDeputyComRespDto> implementAccConditionQueryDeptDeputyCom(@RequestBody @Validated ImplementAccConditionQueryDeptDeputyComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementAccConditionQueryDeptDeputyCom(reqDTO));
    }
/**
   * D1查询就职的部门详情(公共)
   */
    @PostMapping("queryInductionDeptDetailCom")
    public OkrResult<QueryInductionDeptDetailComRespDto> queryInductionDeptDetailCom(@RequestBody @Validated QueryInductionDeptDetailComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionDeptDetailCom(reqDTO));
    }
/**
   * D1批量查询就职的部门(公共)
   */
    @PostMapping("batchQueryInductionDeptCom")
    public OkrResult<BatchQueryInductionDeptComRespDto> batchQueryInductionDeptCom(@RequestBody @Validated BatchQueryInductionDeptComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryInductionDeptCom(reqDTO));
    }
/**
   * D1-3查直属就职记录列表(公共)
   */
    @PostMapping("queryDirectInductionRecordListCom")
    public OkrResult<QueryDirectInductionRecordListComRespDto> queryDirectInductionRecordListCom(@RequestBody @Validated QueryDirectInductionRecordListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryDirectInductionRecordListCom(reqDTO));
    }
/**
   * D1批量查询就职记录快照(公共)
   */
    @PostMapping("batchQueryInductionRecordSnapCom")
    public OkrResult<BatchQueryInductionRecordSnapComRespDto> batchQueryInductionRecordSnapCom(@RequestBody @Validated BatchQueryInductionRecordSnapComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.batchQueryInductionRecordSnapCom(reqDTO));
    }
/**
   * D1-3查询就职记录详情(公共)(边界)
   */
    @PostMapping("queryInductionRecordDetailComBorder")
    public OkrResult<QueryInductionRecordDetailComBorderRespDto> queryInductionRecordDetailComBorder(@RequestBody @Validated QueryInductionRecordDetailComBorderReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionRecordDetailComBorder(reqDTO));
    }
/**
   * D1执行批量部门查就职记录(公共)
   */
    @PostMapping("implementDeptInductionCom")
    public OkrResult<ImplementDeptInductionComRespDto> implementDeptInductionCom(@RequestBody @Validated ImplementDeptInductionComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.implementDeptInductionCom(reqDTO));
    }
/**
   * D1查询部门下人员列表(公共)
   */
    @PostMapping("queryDeptPersonListCom")
    public OkrResult<QueryDeptPersonListComRespDto> queryDeptPersonListCom(@RequestBody @Validated QueryDeptPersonListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryDeptPersonListCom(reqDTO));
    }
/**
   * D1查询就职的部门列表(公共)
   */
    @PostMapping("queryInductionDeptListCom")
    public OkrResult<QueryInductionDeptListComRespDto> queryInductionDeptListCom(@RequestBody @Validated QueryInductionDeptListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryInductionDeptListCom(reqDTO));
    }
/**
   * D1获取基层向上汇报对象
   */
    @PostMapping("obtainBasicUpReportLeader")
    public OkrResult<ObtainBasicUpReportLeaderRespDto> obtainBasicUpReportLeader(@RequestBody @Validated ObtainBasicUpReportLeaderReqDto reqDTO){
    return OkrResult.success(inductionRecordService.obtainBasicUpReportLeader(reqDTO));
    }
/**
   * D1查询员工就职记录列表(公共)
   */
    @PostMapping("queryStaffInductionRecordListCom")
    public OkrResult<QueryStaffInductionRecordListComRespDto> queryStaffInductionRecordListCom(@RequestBody @Validated QueryStaffInductionRecordListComReqDto reqDTO){
    return OkrResult.success(inductionRecordService.queryStaffInductionRecordListCom(reqDTO));
    }
}
